package com.hu.video.controller;

import com.hu.video.entity.UserPrivacySettings;
import com.hu.video.service.IUserPrivacySettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/privacy")
public class UserPrivacySettingsController {
    @Autowired
    private IUserPrivacySettingsService service;

    @GetMapping("/{userId}")
    public UserPrivacySettings getSettings(@PathVariable Long userId) {
        return service.getByUserId(userId);
    }

    @PostMapping("/update")
    public String updateSettings(@RequestBody UserPrivacySettings settings) {
        service.updateSettings(settings);
        return "success";
    }
} 